const {app} = require('electron')
const {createWindow} = require('./main/windows/main')
const {create:createControlWindow} = require('./main/windows/control')
import ipcHandle from './ipc/index.js';
app.allowRendererProcessReuse = false
app.on('window-all-closed', () => {
  // Respect the OSX convention of having the application in memory even
  // after all windows have been closed
  if (process.platform !== 'darwin') {
    app.quit();
  }
});

// app.whenReady().then(createWindow).catch(console.log);

// app.on('activate', () => {
//   // On macOS it's common to re-create a window in the app when the
//   // dock icon is clicked and there are no other windows open.
//   if (mainWindow === null) {
//     createWindow()
//     ipcHandle()
//   };
// });

app.on('ready', () => {
  // On macOS it's common to re-create a window in the app when the
  // dock icon is clicked and there are no other windows open.
  createWindow();
  // createControlWindow()
  ipcHandle();
  // require('./robot')()
});
